package JUNHO.conjuntos;

public class Pc implements Comparable<Object> {

	private String processador;
	private Integer memoriaMB;
	private boolean x64;

	public String getProcessador() {
		return processador;
	}

	public void setProcessador(String processador) {
		this.processador = processador;
	}

	public boolean isX64() {
		return x64;
	}

	public void setX64(boolean x64) {
		this.x64 = x64;
	}

	@Override
	public int compareTo(Object arg0) {
		// TODO Auto-generated method stub
		// return this.getMemoriaMB().compareTo(((Pc)arg0).getMemoriaMB());
		return this.processador.compareTo(((Pc) arg0).processador);
	}

	public Integer getMemoriaMB() {
		return memoriaMB;
	}

	public void setMemoriaMB(Integer memoriaMB) {
		this.memoriaMB = memoriaMB;
	}

	public Pc(String processador, Integer memorioMb) {
		// TODO Auto-generated constructor stub
		this.processador = processador;
		this.memoriaMB = memorioMb;
	}

	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		if (obj instanceof Pc
				&& ((Pc) obj).getProcessador().equals(this.getProcessador())) 
		{
			return true;
		}
		return false;
	}
	
	@Override
	public int hashCode() {
		return this.getMemoriaMB() ^ 14;
	}
	
	@Override
	public String toString() {
		
		return super.toString();
	}

}
